From: Vadim Rutkovsky Date: Tue, 3 Jun 2014 23:40:32 +0000 (+0200) Subject: Honor disable_fsync during checkout also X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~1182 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=ef0057299945ff1d5e687c46ba65eb470263d3d5;p=ostree.git Honor disable_fsync during checkout also Finally, fsync to ensure all entries are on disk, unless disabled. We support disabling this for cases like server-side buildroot construction where we don't need to be robust against power loss --- diff --git a/src/libostree/ostree-repo-checkout.c b/src/libostree/ostree-repo-checkout.c index 7bf83289..417e11f6 100644 --- a/src/libostree/ostree-repo-checkout.c +++ b/src/libostree/ostree-repo-checkout.c @@ -661,10 +661,13 @@ checkout_tree_at (OstreeRepo *self, * this should be configurable for the case where we're constructing * buildroots. */ - if (fsync (destination_dfd) == -1) + if (!self->disable_fsync) { - ot_util_set_error_from_errno (error, errno); - goto out; + if (fsync (destination_dfd) == -1) + { + ot_util_set_error_from_errno (error, errno); + goto out; + } } ret = TRUE;